/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.thupt.b1;

import java.util.Scanner;

/**
 *
 * @author Autumn
 */
public class bai2b {
    public static float a[];
    public static int n,b[];
    public static void main(String args[]){
        nhap();
        solanxuathien();
        hienthi();
                                          }
    public static void nhap(){
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        b=new int[n];a=new float[n];
        for(int i=0;i<n;i++){a[i]=sc.nextFloat();
                             b[i]=0;
                             }
                              }
    public static void hienthi(){
        for(int i=0;i<n;i++)if(b[i]>0)System.out.println(a[i] + "  " + b[i]);
                                 }
    public static void solanxuathien(){
        for(int i=0;i<n;i++)if(b[i]==0){b[i]=1;
                                        for(int j=i+1;j<n;j++)if(a[i]==a[j]){b[j]=-1;
                                                                             b[i]+=1; 
                                                                             }
                                        }
                                        }
}
